package com.example.springmvc.Mapper;

import com.example.springmvc.model.MessageInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface MessagerInfoMapper {
    //添加留言
    @Insert("insert into message_info (`from`,`to`,`message`) values (#{from},#{to},#{message})")
    Integer insertMessage(MessageInfo messageInfo);
    //从数据库中查询
    @Select("select * from message_info where delete_flag=0")
    List<MessageInfo> queryMessage();
}
